<!DOCTYPE html>
<html>

<head>
    <title>HoneycombOverlay</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
        body,
        html {
            width: 100%;
            height: 100%;
            margin: 0;
            font-family: "微软雅黑";
        }

        #allmap {
            width: 100%;
            height: 100%;
        }

        p {
            margin-left: 5px;
            font-size: 14px;
        }
    </style>

    <script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=U3q69k0Dv0GCYNiiZeHPf7BS"></script>
    <script src="../dist/inmap.js"></script>
    <script src="./data/heatData.js"></script>
</head>

<body>
    <div id="allmap"></div>
</body>

</html>
<script>
    var map = new inMap.Map({
        id: document.getElementById('allmap'),
        center: [117.294036, 39.43691],
        zoom: {
            value: 11,
            show: true,
            max: 18,
            min: 8
        }
    })
    var overlay = new inMap.HoneycombOverlay({
        tooltip: {
            show: true,
            // formatter: function (params) {
            //     return params.count;
            // }
            formatter: "{count}"
        },
        legend: {
            show: true,
            title: "图例"

        },
        style: {
            type: "sum",
            colors: [
                "rgba(156,200,249,0.7)", "rgba(93,158,247,0.7)",
                "rgba(134,207,55,0.7)",
                "rgba(252,198,10,0.7)", "rgba(255,144,0,0.7)", "rgba(255,72,0,0.7)",
                "rgba(255,0,0,0.7)"
            ],
            normal: {
                backgroundColor: 'rgba(200, 200, 200, 0.5)',
                padding: 1.5,
                size: 3000,
                unit: 'm', //地理属性单位，米
            },
            mouseOver: {
                shadowColor: 'rgba(255, 250, 255, 1)',
                shadowBlur: 20,
            },
            selected: {
                shadowColor: 'rgba(255, 250, 255, 1)',
                shadowBlur: 20,
            },

        },
        data: data,
        event: {
            onState(state) {
                console.log(state);
            },
            onMouseClick: function (item, event) {
                console.log(JSON.stringify(item));
            }

        }
    });
    map.add(overlay)
</script>